/**
 * Created by Oswald on 2016/11/30.
 */

var path = getRootPath();

document.write('<link href="' + path + '/webjar/bootstrap/3.3.7-1/css/bootstrap.css" rel="stylesheet">');
document.write('<link href="' + path + '/webjar/bootstrap-table/bootstrap-table.css" rel="stylesheet">');
document.write('<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.min.css" rel="stylesheet">');
document.write('<link href="' + path + '/webjar/css/mystyle.css" rel="stylesheet">');

document.write('<script type="text/javascript" src="' + path + '/webjar/jquery/3.1.1/jquery.min.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/webjar/bootstrap/3.3.7-1/js/bootstrap.min.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/webjar/bootstrap-table/bootstrap-table.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/webjar/bootstrap-table/bootstrap-table-zh-CN.min.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/webjar/layer/layer.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/webjar/plugins/layui/layui.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/ServerPath.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/ibcpLayer.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/ibcpAjax.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/TuLayer.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/Sign.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/cookie_util.js" charset="UTF-8"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/ibcpValidate.js"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/NumberKeyBoard.js"></script>');
document.write('<script type="text/javascript" src="' + path + '/WebUI/Public/ibcpSign.js" charset="UTF-8"></script>');


function getRootPath(){
    //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
    var curWwwPath=window.document.location.href;
    //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
    var pathName=window.document.location.pathname;
    var pos=curWwwPath.indexOf(pathName);
    //获取主机地址，如： http://localhost:8083
    var localhostPaht=curWwwPath.substring(0,pos);
    //获取带"/"的项目名，如：/uimcardprj
    var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
    return (localhostPaht+projectName);
}
